from typing import TYPE_CHECKING

if not TYPE_CHECKING:
    ...

if TYPE_CHECKING:
    ...
else:
    ...